package com.linciping.useges.plugin.writer;

import com.google.gson.Gson;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDirectory;
import com.linciping.useges.plugin.bean.Res2SourceFile;

import java.util.List;

public class ModuleResUesgesWriter extends BaseJsonUsegesWriter {

    private final List<Res2SourceFile> res2SourceFileList;

    private static final String FILE_NAME = "ModuleResUseges.json";

    public ModuleResUesgesWriter(Project project, PsiDirectory moduleDirectory, List<Res2SourceFile> res2SourceFileList) {
        super(project, moduleDirectory);
        this.res2SourceFileList = res2SourceFileList;
    }

    @Override
    String getContent() {
        Gson gson = new Gson();
        return gson.toJson(res2SourceFileList);
    }

    @Override
    String getFileName() {
        return FILE_NAME;
    }

}
